<%- include('../includes/head.ejs')%>
</head>
<body>
    <%- include('../includes/navigation.ejs')%>
    <main>
        <% if (products.length > 0) { %> 
           <ul>
            <% products.forEach(p => {%>
             <li>
                 <p><%= p.productData.title %> - <%= p.quantity %></p>
                 <form action="/cart-delete-item" method="POST">
                  <input type="hidden" name="productId" value="<%= p.productData.id %> ">
                  <button class="btn" type="submit">删除</button>
                </form>
             </li>
            <% }) %>
           </ul>
        <% } else { %>
          <h1>购物车里面暂无宝贝!</h1>
        <% } %>
    </main>
    <%- include('../includes/end.ejs')%>